package initialize

import (
	"learn/global"
	"learn/pkg/utils/register/consul"
)

func InitRegister(serviceId string) (consul.RegistryClient, error) {

	register_client := consul.NewRegistryClient(global.ServerConfig.ConsulInfo.Host, global.ServerConfig.ConsulInfo.Port)
	err := register_client.Register(global.ServerConfig.Host, global.ServerConfig.Port, global.ServerConfig.Name, global.ServerConfig.Tags, serviceId)

	return register_client, err

}
